#include <iostream>
#include <pthread.h>
#include "storage_subsystem.h"

void *edge_thread(void *arg){
    communicate_to_edge();
    return nullptr;
}

void *user_thread(void *arg){
    communication_to_user();
    return nullptr;
}

int main(){

    std::cout<<"Holle,World!"<<std::endl;

    pthread_attr_t attr;
    pthread_attr_init(&attr);
    pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);

    pthread_t edge_tid,user_tid;
    pthread_create(&edge_tid,&attr,edge_thread,nullptr);
    pthread_create(&user_tid,/*&attr*/NULL,user_thread,nullptr);
    pthread_join(edge_tid,nullptr);
    pthread_join(user_tid,nullptr);

    return 0;
}